package ca.ualberta.cs.CLRDB.interfaces;

import java.sql.Connection;
import java.util.ArrayList;

import uk.ac.liv.c3connector.AnnotationModel;

public interface AnnotationAccess extends EntityRelAccess{
	
	   /**
	    * @param am (AnnotationModel)
	    * @param username
	    * @param pass
	    * @return  0: ok, 1: user not authenticated, 2: exception
	    */
	   public int storeOrUpdateAnyAnnotation(AnnotationModel am, String username, String pass);
	   
	   /**
	    * @param am (AnnotationModel)
	    * @param username
	    * @param pass
	    * @return  0: ok,  -1: if it is a comment
	    */
//	   public int storeOrUpdateIfNotComment(AnnotationModel am, String username, String pass);
	   
	/**
	    * @param am (AnnotationModel)
	    * @param username
	    * @param pass
	    * @return  0: ok, 1: user not authenticated, 2: exception
	    */
//	public int storeOrUpdateAnnotation(AnnotationModel am, String username, String pass);
	
	public ArrayList<AnnotationModel> findAnnosWithResourceUri(String resourceUri);
	public ArrayList<AnnotationModel> findAnnosWithSameBib(String resourceUri);
	public ArrayList<AnnotationModel> findAnnosWithSameMd5Base64(String checksum);
	public ArrayList<AnnotationModel> findAnnosWithSameMultivalentBase64Md5Text(String checksum);
	
	/**
    * @param ID
    * @param username
    * @param pass
    * @return 0:ok, 1:not authenticated, 2:exception, 3:has reply
    */
	public int deleteAnnotation(Integer ID,String username, String pass);
	public int deleteAnnotationByFabId(String id, String username, String pass);
		
}
